<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 数组方法 </title>
</head>
<body>
<h2>Pushing</h2>
<p>push() 方法（在数组结尾处）向数组添加一个新的元素：</p>

<p id="demo1"></p>
<p id="demo2"></p>

<script>
  var fruits=["Banana","Orange", "Apple", "Mango"];
  document.getElementById("demo1").innerHTML=fruits;

  fruits.push("Kiwi");
  document.getElementById("demo2").innerHTML=fruits;
</script>
</body>
</html>

<!--
运行结果：
Banana,Orange,Apple,Mango

Banana,Orange,Apple,Mango,Kiwi

push() 方法返回新的数组长度。-->